﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DataSetEscorpiusTourTableAdapters;

/// <summary>
/// Descripción breve de CaracteristicasBLL
/// </summary>
public class CaracteristicasBLL
{
	public CaracteristicasBLL(){}

    //conexion con base de datos EscorpiusTour
    private CARACTERISTICAS_MOVILTableAdapter _Caracteristicas_MovilAdapter = null;
    protected CARACTERISTICAS_MOVILTableAdapter Adapter
    {
        get
        {
            if (_Caracteristicas_MovilAdapter == null)
                _Caracteristicas_MovilAdapter = new CARACTERISTICAS_MOVILTableAdapter();

            return _Caracteristicas_MovilAdapter;
        }
    }

    private CARACTERISTICAS_MOVIL_CONSULTATableAdapter _consulta = null;
    protected CARACTERISTICAS_MOVIL_CONSULTATableAdapter Ad
    {
        get
        {
            if (_consulta == null)
                _consulta = new CARACTERISTICAS_MOVIL_CONSULTATableAdapter();
            return _consulta;
        }
    }

    //operacion de consulta
    //seleccionar todas las caracteristicas segun id
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Select, true)]
    public DataSetEscorpiusTour.CARACTERISTICAS_MOVIL_CONSULTADataTable verCarMoviles(string patente)
    {
        return Ad.VerCaracteristicasMovil(patente);
    }

    //insertar Caracteristica
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Insert, true)]
    public int insertarCaracteristica(string nombre, string descripcion)
    {
        int filas_afectadas = Adapter.Insert(nombre, descripcion);
        if (filas_afectadas == 0) return 0;
        else return 1;
    }

    //eliminar Caracteristica
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Delete, true)]
    public int eliminarCaracteristica(int id)
    {
        int filas_afectadas = Adapter.Delete(id);
        if (filas_afectadas == 0) return 0;
        else return 1;
    }

    //modificar Caracteristica
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Update, true)]
    public int modificarCaracteristica(string nombre, string descripcion, int id)
    {
        int filas_afectadas = Adapter.Update(nombre, descripcion, id);
        if (filas_afectadas == 0) return 0;
        else return 1;
    }

    //seleccionar todas las caracteristicas
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Select, true)]
    public DataSetEscorpiusTour.CARACTERISTICAS_MOVILDataTable mostrarCaracteristicas()
    {
        return Adapter.GetData();
    }
    
    //seleccionar todas las caracteristicas segun id
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Select, true)]
    public DataSetEscorpiusTour.CARACTERISTICAS_MOVILDataTable mostrarCaracteristicasById(int id)
    {
        return Adapter.GetDataById(id);
    }
}
